using System;
using System.Collections.Generic;
using System.Text;
using NBusiness.Query;

namespace NBusiness.MySql.Query
{
    public class MySqlParameter : IParameter
    {
        #region Member fields and properties
        private string _name; 
        #endregion

        #region Constructors
        public MySqlParameter() { }
        public MySqlParameter(string name)
        {
            _name = name;
        }
        #endregion

        #region IParameter Members

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        #endregion

        #region IRelationalElement Members

        public string ToSql()
        {
            return (_name.StartsWith("@") ? 
                _name : 
                "@" + _name);
        }

        #endregion
    }
}
